require "Common/define"
require "Logic/Config"
require "Common/functions"

RedDotsPetMatingHandler ={};
local this = RedDotsPetMatingHandler;

function RedDotsPetMatingHandler.init()
    CloseEvent(Config.EventType.RefreshOthersApplyList,this.update);
    ListenEvent(Config.EventType.RefreshOthersApplyList,this.update);

    return this;
end


--参数 无
function RedDotsPetMatingHandler.getFlag(...)
    if logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.Pet,false) then
        local applies = logicMgr.PetManager.applies;
        if #applies > 0 then
            return Config.RedDotsFlagState.Needful;
        end
    end
    return Config.RedDotsFlagState.None;
end


function RedDotsPetMatingHandler.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.PetMating);
end